package hao.itheima.service.impl;

import hao.itheima.entity.Clazz;
import hao.itheima.mapper.ClazzMapper;
import hao.itheima.service.ClazzService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

@Service
public class ClazzServiceImpl implements ClazzService {

    @Autowired
    private ClazzMapper clazzMapper;
    @Override
    public List<Clazz> list() {
        List<Clazz> list = clazzMapper.list();
        return list;
    }



    @Override
    public Integer insert(Clazz clazz) {
        clazz.setCreateTime(LocalDateTime.now());
        clazz.setUpdateTime(LocalDateTime.now());
       return clazzMapper.insert(clazz);
    }
}
